package com.moliyou.t2.mapper;

import com.moliyou.t2.VO.CommentVO1;
import com.moliyou.t2.VO.CommentVO2;
import com.moliyou.t2.pojo.comment;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface commentMapper {
   // @Insert("insert into comment(content,created,user_id,weibo_id) values(#{content},#{created},#{userId},#{weiboId})")
    int insertComment(comment comment);
    //@Delete("delete from comment where id=#{id}")
    int deleteComment(Integer id);
    @Update("update comment set content=#{content} where id=#{id}")
    int updateComment(comment comment);
    @Select("select content,user_id userId from comment where id=#{id}")
    CommentVO1 selectCommentById(Integer id);

    @Select("select id,content,user_id userId from comment where user_id=#{id}")
    List<CommentVO2> select_id_content_userId_by_userId(Integer id);

}
